/* On Load tell the Comm control to Connect to the Server */
function InitRpmCC_AD() {
top.MainLoaded = true; // Flag that Main is now loaded
Calendar7 = Calendar_init("Calendar7",true);
/* Connect to Server */
Hp = parseInt( document.body.RPMHostPort,10);
RpmCC_AD.Connect(document.body.RPMHostIP,Hp, "");
processSizeChange();
Es_StopDate.CalObj = Calendar7;
initCalendarTime(); // go initialize Calendar and Time fields
for ( var i=0; i<12; i++ ) {
stxt = (i == 0) ? "12 AM " : i+" AM ";
el = addElementToSelect(AL_RAT,stxt);
el.value = i;
if ( i == 1 ) {
el.selected = "selected";
}
}
for ( var i=0; i<12; i++ ) {
stxt = (i == 0) ? "12 PM " : i+" PM ";
el = addElementToSelect(AL_RAT,stxt);
el.value = i + 12;
}
for ( var i=1; i<61; i++ ) {
stxt = ""+i+" ";
el = addElementToSelect(AL_DOT,stxt);
el.value = i;
if ( i == 14 ) {
el.selected = "selected";
}
}
for ( var i=0; i<24; i++ ) {
stxt = ""+(65+(i*5))+" ";
el = addElementToSelect(AL_DOT,stxt);
el.value = 65 + (i*5);
}
}
function processReconnect() {
Tid = null;
if ( RpmCC_AD.IsConnected() ) {
Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
return;
}
RpmCC_AD.Connect(document.body.RPMHostIP,Hp, "");
}
function processConnectConfirmed() {
// Restore Filter and Computer Store
if ( ReconnectEvent == false ) {
if ( RpmCC_AD.GetAutoPurge() ) {
top.Rstatus.Pstat("Unable to initiate read for current AutoPurge parameters",true);
}
if ( RpmCC_AD.GetObjectFilter() ) {
top.Rstatus.Pstat("Unable to initiate read for current ObjectFilter parameters",true);
}
ReconnectEvent = true;
}
top.Rstatus.Pstat("Connected");
if ( Tid != null ) {
clearTimeout(Tid); // stop timeout routine
}
Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
}
function processConnectionCheck() {
Tid = null;
RpmCC_AD.SendKeepAlive("Check");
Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
}
/* On Unload tell the Comm control to Disconnect from the Server */
function DiscoRpmCC_AD() {
RpmCC_AD.Disconnect(); // Disconnect from Server
top.banner.processStopCommX();
if ( Tid != null ) {
clearTimeout(Tid); // stop timeout routine
}
if ( CTid != null ) {
clearTimeout(CTid); // stop timeout routine
}
}
// Process Export and Import of 'Admin' Table Data
function processImport() {
// If DB Import Update Required, Wiat Until Complete
if ( confirm("Are you sure you want to Import saved 'Admin' data now?\n -Press OK to continue with import of the saved 'Admin' data\n -Press Cancel to ignore") ) {
top.document.title = "MonitorIT Process 'Admin' Data Import";
}
}
function processExport() {
// If DB Import Update Required, Wiat Until Complete
if ( confirm("Are you sure you want to Export 'Admin' data to a file now?\n -Press OK to continue with export of the 'Admin' data\n -Press Cancel to ignore") ) {
if ( RpmCC_AD.DatabaseValuesDeleteOlderThan(Edt) ) {
PurgeInProgress = false;
AlarmClock.src="Images/AlarmClock.gif";
top.banner.processStopCommX();
top.Rstatus.Pstat("Unable to flag Database records for deletion",true);
}
}
// Process Purge button press
function processPurgeClick() {
if ( !confirm("Are you sure you want to Compact the database now?\n -Compact closes the database and a large database may take up to 1 hour to complete!\n\n -Compact only applies to the default Access database\n -Use SQL Server tools to Compact the SQL Server database\n\nPress 'OK' to Compact; Press 'Cancel' to ignore") ) {
PurgeUI.style.display=""; // Enable this Tab's view
break;
case "AutoTab" :
AutoUI.style.display=""; // Enable this Tab's view
break;
case "ExImTab" :
ExImUI.style.display=""; // Enable this Tab's view
break;
case "ObjectsTab" :
ObjectsUI.style.display=""; // Enable this Tab's view
break;
}
}
function processAutoApplyClick() {
var EAP = (AL_EAP.checked) ? "1" : "0";
var DOT = AL_DOT.options[AL_DOT.selectedIndex].value;
var RAT = AL_RAT.options[AL_RAT.selectedIndex].value;
var RATtxt = AL_RAT.options[AL_RAT.selectedIndex].text;
var ucon = false;
if ( EAP == "0" ) {
if ( confirm("Are you sure you want to disable the automatic Database Purge?\n\n Press OK to proceed with disable.\n Press CANCEL to ignore.") ) {
ucon = true;
}
}
else {
if ( confirm("Are you sure you want to enable the automatic Database Purge?\n-Run Purge everyday at "+RATtxt+"?\n-Discard monitored data older than "+DOT+" days?\n\n Press OK to continue.\n Press CANCEL to ignore.") ) {
ucon = true;
}
}
if ( ucon == true ) {
if ( RpmCC_AD.SetAutoPurge(EAP+"~"+DOT+"~1~"+RAT) ) {
top.Rstatus.Pstat("Unable to set the AutoPurge parameters",true);
if ( confirm("Are you sure you want to disable the Object Filtering?\n\n Press OK to proceed with disable.\n Press CANCEL to ignore.") ) {
ucon = true;
}
}
else {
var OFL = "Are you sure you want to enable the Object Filtering using the following list:\n";
var warr = new Array();
var ts;
warr = AL_ObjFilter.value.split(";");
for ( var i=0; i<warr.length; i++ ) {
ts = TrimLeadingSpaces(warr[i]);
if ( ts == "" ) {
continue;
}
OFL += " - " + ts + "\n";
}
OFL += "\n Press OK to continue.\n Press CANCEL to ignore."
if ( confirm(OFL) ) {
ucon = true;
}
}
if ( ucon == true ) {
if ( RpmCC_AD.SetObjectFilter(OFE+"~"+AL_ObjFilter.value) ) {
top.Rstatus.Pstat("Unable to set the ObjectFilter parameters",true);
alert("Unable to set the ObjectFilter parameters");
}
else {
top.Rstatus.Pstat("ObjectFilter Set",true);
if ( OFE == "0" ) {
alert("ObjectFiltering is now Disabled!");
}
else {
alert("ObjectFilter Set! Filter process scheduled to start shortly as a background task.\n\nYou can view the progress via the MonitorIT Server Log display");
<td colspan="2" class="inputlabel" align="left" width="*"> Export 'Admin' Data Before Updating: </td>
</tr>
<tr>
<td align="right" width="150"></td>
<td align="center" width="205"><button id="ExportButton" title="Export 'Admin' Data from the Database to a File for later Import" onclick='processExport()' style="width:150px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand"><img src="images/DataSave.gif" align="absmiddle" height="17" width="16"> Export 'Admin' Data</button></td>
<td colspan="2" class="inputlabel" align="left" width="*"> Import 'Admin' Data After Updating: </td>
</tr>
<tr>
<td align="right" width="150"></td>
<td align="center" width="205"><button id="ImportButton" title="Import 'Admin' Data from the file where it was previously saved by an Export" onclick='processImport()' style="width:150px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand"><img src="images/DataSave.gif" align="absmiddle" height="17" width="16"> Import 'Admin' Data</button></td>